<?

/**
* local collection functions of tocmenu_14
*
* @author Adesanto Asman
* @version 1.0
* @license Free
* @copyright Copyright (c)2007, Adesanto Asman
* @package CLFetchers
*
*/

/**
* @package CLFetchers
*
*/
class CLFetchers{

  /**
   * list f data detail
   *
   * @param Database  $Db
   * @param string    $cbCode
   * @param string    $srcDb
   * @param integer   $nDetail
   * @param array     $lstDetail
   */
  function fetchLstDataDetail(&$Db,
                               $cbCode,
                               $srcDb,
                              &$nDetail,
                              &$lstDetail){

    $query	= "SELECT *
               FROM ".$srcDb."
               WHERE	C_B_CODE='".$cbCode."'
               ORDER BY NO ASC";

    $Db->execFetchQuery($query,
                        $nDetail,
                        $lstDetail);
  }

  /**
   * list of data header
   *
   * @param Database  $Db
   * @param string    $cbCode
   * @param string    $srcDb
   * @param integer   $nHeader
   * @param array     $lstHeader
   */
  function fetchLstDataHeader(&$Db,
                               $cbCode,
                               $srcDb,
                              &$nHeader,
                              &$lstHeader){

    $query	= "SELECT *
               FROM ".$srcDb."
               WHERE	C_B_CODE='".$cbCode."' ";

    $Db->execFetchQuery($query,
                        $nHeader,
                        $lstHeader);
  }


  /**
   * list of tx
   *
   * @param Database  $Db
   * @param string    $condt
   * @param string    $srcDb
   * @param integer   $nrows
   * @param array     $result
   */
  function fetchLstTransaction(&$Db,
                                $condt,
                                $srcDb,
                               &$nrows,
                               &$result){

    $query	= "SELECT *
               FROM ".$srcDb."
               ORDER BY C_B_CODE ASC";

    $Db->execFetchQuery($query,
                        $nrows,
                        $result);
  }
}

?>